package com.xxxx.pojo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @author achao
 * @version 1.0
 */

@Data
@NoArgsConstructor
@AllArgsConstructor
public class R<T> {

    private long code;
    private String message;
    private T obj;


    public static  <T> R<T> success(String message) {
        return new R(200, message, null);
    }
    public static  <T> R<T> success(T data) {
        return new R(200, "", data);
    }
    public static  <T> R<T> success(String message,T data) {
        return new R(200, message, data);
    }

    public static <T> R<T> error(String message) {
        return new R(500, message, null);
    }


}
